package cn.wostore.wxhelper.Xposed;

import cn.wostore.wxhelper.utils.TxtUtil;
import de.robv.android.xposed.XC_MethodHook;
import de.robv.android.xposed.XposedBridge;

/**
 * @author wuch
 * @date 2018/12/26 0026
 */
public class CopyDatabaseHook extends XC_MethodHook {
    private final LoadHook loadHook;

    CopyDatabaseHook(LoadHook loadHook) {
        this.loadHook = loadHook;
    }

    @Override
    protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
        super.beforeHookedMethod(param);
        String path = (String) param.args[0];
        this.loadHook.dbPath = path;
        XposedBridge.log("获取成功");
        if (!path.contains("EnMicroMsg.db"))
            return;
        TxtUtil.writeFile("/mnt/sdcard/wxhelper/", "db.txt", path);

    }
}
